package com.google.gwt.gfx.client.graphics.vml;

import com.google.gwt.gfx.client.graphics.Group;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;

public abstract class VMLObject extends Group {

	private VMLCoordOriginStyle coordOriginRef;

	private VMLCoordSizeStyle coordSizeRef;

	protected VMLObject(Element element) {
		super(element);

		coordOriginRef = new VMLCoordOriginStyle(this);
		coordSizeRef = new VMLCoordSizeStyle(this);
	}

	public VMLCoordOriginStyle coordOrigin() {
		return coordOriginRef;
	}

	public VMLCoordSizeStyle coordSize() {
		return coordSizeRef;
	}

	public final void resize(String width, String height) {
		DOM.setStyleAttribute(getElement(), "width", width);
		DOM.setStyleAttribute(getElement(), "height", height);
		DOM.setElementProperty(getElement(), "coordsize", width + "," + height);
	}

}
